<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var arrNew=[];
            var arr=[2,45,67,0,34,0];
            for(var  i in arr){
            	if(arr[i]!==0){
           		arrNew.push(arr[i]);
            	}
            }
            alert(arrNew)
		</script>
	</body>
</html>